package com.ttw.demo;


import android.app.Application;
import android.content.Intent;
import android.util.Log;

import com.blankj.utilcode.util.LogUtils;
import com.ttw.Callback;
import com.ttw.TTW;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        TTW.startWork(this, new Callback() {
            @Override
            public void onStart() {

            }

            @Override
            public void onStop() {

            }

            @Override
            public void onReceiver(HappenEvent happenEvent) {
                LogUtils.e("onReceiver", "时间"+System.currentTimeMillis());
                if (happenEvent == HappenEvent.ACTION_CLOSE_SYSTEM_DIALOGS) {
                    //这里有监听ACTION_CLOSE_SYSTEM_DIALOGS，这里就不要弹出窗口了，没操作就会不弹了
                    //这里你还可以做一些监听，比如如果当前页面本应用就不弹窗了
                }else if (happenEvent == HappenEvent.ACTION_SCREEN_ON) {
                    ScreenLockActivity.startActivity(App.this);
//                    Intent intent = new Intent(App.this, ScreenLockActivity.class);
//                    ActivityUtils.hookJumpActivity(App.this,intent);
                } else {
                    ScreenLockActivity.startActivity(App.this);
//                    Intent intent = new Intent(App.this, ScreenLockActivity.class);
//                    ActivityUtils.hookJumpActivity(App.this,intent);
                }
            }
        });
    }
}
